package com.ruoyi.redisDemo.srb;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.entity.SysDictType;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.mapper.SysDictTypeMapper;
import com.ruoyi.system.service.ISysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.Cacheable;

import java.util.List;

@RestController("/AnnoCache")
public class DictRedisCacheController extends BaseController {

    @Autowired
    private RedisTemplate redisTemplate;

    @Autowired
    private ISysDictTypeService sysDictTypeService;

    @GetMapping("/list")
    public TableDataInfo listDictType(){
        startPage();
        List<SysDictType> sysDictTypes = sysDictTypeService.selectDictTypeList(new SysDictType());

        return getDataTable(sysDictTypes);
    }
}
